#include<iostream>
using namespace std;

class Printer{
public:
    static Printer *getInstance(void){
        return printer;
    }
private:
    Printer(string name)
    :mName(name)
    {
        cout << "构造函数" << endl;
    }
private:
    static Printer *printer;
    string mName;
};

Printer * Printer::printer = new Printer("惠普");

int main(int argc, char *argv[])
{
    Printer *printer = Printer::getInstance();
    Printer *printer1 = Printer::getInstance();
    cout << printer << endl;
    cout << printer1 << endl;

}
